package com.socool;

import java.security.MessageDigest;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.os.Bundle;
import android.util.Base64;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.socool.login.Act_Login_FB;

public class Act_Login extends Activity {

	
	Button facebookLogin;

	Button facebookSignup;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.login_main);
		
		facebookLogin = (Button)findViewById(R.id.facebookLogin);
		
		facebookSignup = (Button)findViewById(R.id.facebookSignup);
		
		
	
		
		facebookLogin.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {

				  Intent intent = new Intent(Act_Login.this, Act_Login_FB.class);
				  intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
			      startActivity(intent);
			      overridePendingTransition(R.anim.fade,R.anim.hold);
				
			}
		});
		
		  try {
	            PackageInfo info = getPackageManager().getPackageInfo("com.example.socool_login",
	                    PackageManager.GET_SIGNATURES);
	            for (Signature signature : info.signatures) {
	                MessageDigest md = MessageDigest.getInstance("SHA");
	                md.update(signature.toByteArray());
	                Log.d("key",
	                        Base64.encodeToString(md.digest(), Base64.DEFAULT));
	            }
	        } catch (Exception e) {
	        	  Log.d("key","Error: "+e.getMessage());
	        } 
	
		
	}

	

}